#ifndef FRIEND_H
#define FRIEND_H

#include <QWidget>
#include <QTextEdit>
#include <QListWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include "online.h"
#include "protool.h"




class Friend : public QWidget
{
    Q_OBJECT
public:
    explicit Friend(QWidget *parent = nullptr);
    void showAllOnlineUser(PDU *pdu);
    QString m_strSearchName;
    void updateFriendList(PDU *pdu);
    void updateGroupMsg(PDU *pdu);
    QListWidget *getFriendList();
signals:

public slots:
    void showOnline();
    void searchUser();
    void flushFriend();
    void deleteFriend();
    void privateChate();
    void GroupChat();

private:
    QTextEdit *m_pShowMsgTE;//显示信息
    QListWidget *m_pFriendListWidget;//好友列表
    QLineEdit *m_pInputMsgLE;//输入框
    QPushButton *m_pDelFriendPB;//删除好友
    QPushButton *m_pFlushFriendPB;//刷新好友
    QPushButton *m_pShowOnlineUsrPB;//展示在线好友
    QPushButton *m_pSearchUsrPB;//查找好友
    QPushButton *m_pMsgSendPB;//发送消息，这个就是为了群聊准备的，通过槽函数关联过来
    QPushButton *m_pPrivateChatPB;//私聊按钮
    Online *m_pOnline;


};

#endif // FRIEND_H
